const plugins = []
// 测试环境的接口地址
let baseURL = 'http://127.0.0.1:8000'
if (process.env.NODE_ENV === 'production') {
  plugins.push('transform-remove-console')
  // 生产环境的接口地址
  baseURL = ''
}
export default {
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'internet-technology',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' }
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: ['element-ui/lib/theme-chalk/index.css', '~assets/css/animate.css'],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: ['@/plugins/element-ui', '@/plugins/axios', '@/plugins/tools'],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true,

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [
    // https://go.nuxtjs.dev/eslint
    '@nuxtjs/eslint-module'
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [],

  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
    transpile: [/^element-ui/],
    babel: {
      plugins
    }
  },
  server: {
    port: 3000, // default: 3000
    host: '0.0.0.0' // default: localhost,
  },
  env: {
    baseURL
  }
}
